<template>
  <div class="iframe">
    <el-dialog title="码垛机" :visible.sync="showDialogmd" width="700px" @close="handleClose('mdj')">
      <iframe src="http://192.168.10.212:3000/?MADXQ" frameborder="0" style="width: 100%;height:100%"></iframe>
    </el-dialog>

    <el-dialog title="吹瓶机" :visible.sync="showDialogcp" width="700px" @close="handleClose('cpj')">
      <iframe src="http://192.168.10.212:3000/?CHUIPXQ" frameborder="0" style="width: 145%;height:145%"></iframe>
      <!-- <span slot="footer" class="dialog-footer">
            <el-button @click="showDialogcp = false">取 消</el-button>
            <el-button type="primary" @click="showDialogcp = false">确 定</el-button>
        </span>-->
    </el-dialog>
  </div>

</template>

<script>
export default {
  // 接受父组件传递的值
  props: {
    openmdst: {
      type: Boolean,
      default: false,
    },
    opencpjst: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      // 控制弹出框显示隐藏
      showDialogcp: false,
      showDialogmd: false,
    };
  },
  methods: {
    // 弹出框关闭后触发
    handleClose(parm) {
      // 子组件调用父组件方法，并传递参数
      this.$emit("changeShow", "false", parm);
    },
  },
  watch: {
    // 监听 addOrUpdateVisible 改变
    openmdst(oldVal, newVal) {
      this.showDialogmd = this.openmdst;
    },
    opencpjst(oldVal, newVal) {
      this.showDialogcp = this.opencpjst;
    },
  },
};
</script>

<style >
.iframe .el-dialog__body {
  height: 580px;
  overflow: auto;
}
</style>


